package com.hb.trade.client.project;

import com.hb.core.pojo.parent.PageResult;
import com.hb.core.pojo.project.opening.dto.OpeningBidInfoDTO;
import com.hb.core.pojo.project.opening.dto.OpeningBidTenderDTO;
import com.hb.core.pojo.project.opening.dto.OpeningBidTenderRecordDTO;
import com.hb.core.pojo.project.opening.entity.OpeningBidInfo;
import com.hb.core.pojo.project.opening.entity.OpeningBidTender;
import com.hb.core.pojo.project.section.dto.BidSectionDTO;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 开标大厅Feign接口
 *
 * @author Lix1ang
 * @date 2022-1-12 13:51:25
 */
@FeignClient("hb-project")
public interface BidOpeningHallClient {

    /**
     * 根据项目Id查询今日开标标段分页
     *
     * @param bidSectionDTO
     * @return
     */
    @PostMapping("/hall/pageTodayBidOpeningSection")
    Message<PageResult> pageTodayBidOpeningSection(@RequestBody BidSectionDTO bidSectionDTO);

    /**
     * 根据标段Id查询开标记录表数据
     *      (如果是第一次进入开标大厅，则新增一条记录)
     *
     * @param openingBidInfo
     * @return
     */
    @PostMapping("/hall/getOpeningBidInfoBySectionId")
    Message<OpeningBidInfoDTO> getOpeningBidInfoBySectionId(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 统计大厅各阶段人数（总投标人数、有效投标人数、无效投标人数、已解密人数、已签名人数）
     *
     * @param openingBidInfo   记录表主键Id
     * @return
     */
    @PostMapping("/hall/countHallInfo")
    Message<Map> countHallInfo(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 获取开标大厅实时记录数据(招标方)
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/listBidOpeningAllRecord")
    Message<List<OpeningBidTenderRecordDTO>> listBidOpeningAllRecord(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 获取开标大厅实时记录数据(投标方)
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/listBidOpeningRecord")
    Message<List<OpeningBidTenderRecordDTO>> listBidOpeningRecord(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 获取开标大厅投标方状态数据(招标方)
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/listBidOpeningTender")
    Message<List<OpeningBidTenderDTO>> listBidOpeningTender(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 开始签到
     *
     * @param openingBidInfo
     * @return
     */
    @PostMapping("/hall/startSignin")
    Message<OpeningBidInfo> startSignin(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 开始开标
     *
     * @return
     */
    @PostMapping("/hall/startBidOpening")
    Message<OpeningBidInfo> startBidOpening(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 开始解密
     *
     * @return
     */
    @PostMapping("/hall/startDecrypt")
    Message<OpeningBidInfo> startDecrypt(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 结束解密
     *
     * @return
     */
    @PostMapping("/hall/endDecrypt")
    Message<OpeningBidInfo> endDecrypt(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 开始唱标
     *
     * @return
     */
    @PostMapping("/hall/startSing")
    Message<OpeningBidInfo> startSing(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 开始确认
     *
     * @return
     */
    @PostMapping("/hall/startConfirm")
    Message<OpeningBidInfo> startConfirm(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 结束确认
     *
     * @return
     */
    @PostMapping("/hall/endConfirm")
    Message<OpeningBidInfo> endConfirm(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 开标结束
     *
     * @return
     */
    @PostMapping("/hall/endBidOpening")
    Message<OpeningBidInfo> endBidOpening(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 设置项目流标
     *
     * @return
     */
    @PostMapping("/hall/setFlowBid")
    Message<OpeningBidInfo> setFlowBid(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 查看开标记录
     *
     * @return
     */
    @PostMapping("/hall/getOpeningBidInfo")
    Message<OpeningBidInfo> getOpeningBidInfo(@RequestBody OpeningBidInfo openingBidInfo);

    /**
     * 查看开标一览表
     *
     * @param openingBidInfo
     * @return
     */
    @PostMapping("/hall/viewBidOpeningSchedule")
    Message<List<OpeningBidTender>> viewBidOpeningSchedule(@RequestBody OpeningBidInfo openingBidInfo);
    /**
     *
     * @Description:更新开标一览表表内容
     * @Author: zhongdl
     * @Date:2022/5/17 17:09
     * @param openingBidInfo:
     * @return: {@link Message< Boolean> }
     **/
    @PostMapping("/hall/updateBidOpeningSchedule")
    Message<Boolean> updateBidOpeningSchedule(@RequestBody OpeningBidInfo openingBidInfo);


    //------------------------------------------  投标方端接口  ------------------------------------------

    /**
     * 根据开标记录Id与投标人Id查询投标方信息
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/getOpeningBidTender")
    Message<OpeningBidTender> getOpeningBidTender(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 投标人签到
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/bidderSignin")
    Message bidderSignin(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 投标人解密
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/bidderDecrypt")
    Message bidderDecrypt(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 投标人确认
     *
     * @param openingBidTender
     * @return
     */
    @PostMapping("/hall/bidderComfirm")
    Message bidderComfirm(@RequestBody OpeningBidTender openingBidTender);

    /**
     * 根据企业ID和日期查询当日开标标段
     * @param bidSectionDTO
     * @return
     * @author ljs
     */
    @PostMapping("/hall/pageHomeTodayOpeningSection")
    Message<PageResult> pageHomeTodayOpeningSection(@RequestBody BidSectionDTO bidSectionDTO);
    /**
     *
     * @Description: 根据企业ID和日期查询当日开标标段 不带分页
     * @Author: zhongdl
     * @Date:2022/3/9 13:08
     * @param bidSectionDTO:
     * @return: {@link Message< List< BidSectionDTO>> }
     **/
    @PostMapping("/hall/listTodayBidOpeningSection")
    Message<List<BidSectionDTO>> listTodayBidOpeningSection(@RequestBody BidSectionDTO bidSectionDTO);
    /**
     *
     * @Description:查询投标人标段的解密记录
     * @Author: zhongdl
     * @Date:2022/2/24 9:02
     * @param openingBidTender:
     * @return: {@link Message< OpeningBidTender> }
     **/
    @PostMapping("/openingBidTender/getOpeningBidTenderBySection")
    Message<OpeningBidTender> getOpeningBidTenderBySection(@RequestBody OpeningBidTender openingBidTender);

}
